package com.vegetable.modules.entity.finance;

import com.baomidou.mybatisplus.annotation.TableField;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import com.vegetable.common.base.BaseEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springframework.format.annotation.DateTimeFormat;

import java.math.BigDecimal;
import java.util.Date;

/**
 * <p>
 * 财务收款管理
 * </p>
 *
 * @author wangruijie
 * @since 2024-04-13
 */
@Data
@EqualsAndHashCode(callSuper = false)
@ApiModel(value="FinancialCollectionDetail对象", description="财务收款管理提交detailPO类")
public class FinancialCollectionDetail extends BaseEntity {

    @ApiModelProperty(value = "销售收款id")
    @JsonSerialize(using = ToStringSerializer.class)
    private Long mainId;

    @ApiModelProperty(value = "销售出库表id")
    @JsonSerialize(using = ToStringSerializer.class)
    private Long orderId;

    @ApiModelProperty(value = "销售收款单号")
    @TableField(exist = false)
    private String mainOrderNo;

    @ApiModelProperty(value = "销售出库单号")
    private String docNo;

    @ApiModelProperty(value = "批次号")
    private String lotNo;

    @ApiModelProperty(value = "车次")
    private String trainNum;

    @ApiModelProperty(value = "订单时间")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    @JsonFormat(locale = "zh", timezone = "GMT+8", pattern = "yyyy-MM-dd")
    private Date orderTime;

    @ApiModelProperty(value = "未对账金额")
    private BigDecimal verifyMonet;

    @ApiModelProperty(value = "实收金额")
    private BigDecimal money;

    @ApiModelProperty(value = "提成-对外")
    private BigDecimal commissionOut;

    @ApiModelProperty(value = "扣款")
    private BigDecimal deductionMoney;

    @TableField(exist = false)
    @ApiModelProperty(value = "创建时间")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    @JsonFormat(locale = "zh", timezone = "GMT+8", pattern = "yyyy-MM-dd")
    private Date createTime;

    @TableField(exist = false)
    private String accountName;


    private String remark;

    @TableField(exist = false)
    private String totalRemark;
    /**
     * 相关销售订单的销售金额
     */
    @TableField(exist = false)
    private BigDecimal salesMoney;
    /**
     * 相关销售订单的已回款金额
     */
    @TableField(exist = false)
    private BigDecimal receivedTotal;
    /**
     * 相关销售订单的已扣款金额
     */
    @TableField(exist = false)
    private BigDecimal deductionTotal;
}
